#ifndef _FACTORY
#define _FACTORY

#include "spaceShip.h"
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>

#define MAX_FACTORY_WEAPON 20
#define MAX_FACTORY_FREIGHT 50
#define MAX_FACTORY_PASSENGER 10
#define MAX_FACTORY_SPACESHIP 20

typedef enum {supplies, tech, pirateSlaves, pirateDrugs, garage} kind;

/*Struct factory*/
typedef struct{
    char name[30];

    int hull,
        shield,
        posX,
        posY,
        cargoBaySize,
        weaponSlot,
        ID,
        nbWeapon,
        nbFreight,
        nbPassenger,
        nbSpaceShip,
        hauteur,
        largeur;

    kind factoryKind;

    weapon* tabWeapon[MAX_FACTORY_WEAPON];
    freight* tabFreight[MAX_FACTORY_FREIGHT];
    passenger* tabPassenger[MAX_FACTORY_PASSENGER];
    spaceShip* tabSpaceShip[MAX_FACTORY_SPACESHIP];
}factory;

factory* createFactory();/*créer une factory*/

void destroyFactory(factory* fcty);/*détruit une factory, fcty doit être préalablement initialisé*/

void initFactory(factory* fcty, char name[30], int hull, int shield, int cargoBaySize, int weaponSlot, int ID);/*initialiste une factory*/

void setFactoryPos(factory* fcty, int x, int y);/*modifie la position d'une factory*/

void showFactoryInfo(factory ftcy);/*affiche les informations d'une factory (texte)*/

void addFactoryFreight(factory* fcty, freight* frght);/*ajoute de la marchandise à une factory*/

void addFactorySpaceShip(factory* fcty, spaceShip* s);/*ajoute un vaisseau à une factory*/

void showFactoryInventory(factory fcty);/*affiche l'inventaire d'une factory (texte)*/

void SDL_ShowFactorySpaceShip(SDL_Surface* screen, TTF_Font* font, factory fcty);/*affiche les vaisseaux d'une factory (SDL)*/

void SDL_ShowFactoryInventory(SDL_Surface* screen, TTF_Font* font, factory fcty);/*affiche l'inventaire d'une factory (SDL)*/

int returnPrice(factory fcty, freight* fght); /* renvoie un int : le prix modifie */

#endif
